home *** CD-ROM | disk | FTP | other *** search
- /*
- dumpimg.c
-
- ベタで出力された3万色画像データを画面に表示
- */
-
- #include <stdio.h>
- #include <conio.h>
- #include <ryosuke.h>
- #include <usrlib.h>
-
- int main(int argc, char *argv[])
- {
- FILE *fp;
- int width, height;
- if (argc < 4)
- {
- printf("usage: dumpimg <filename> <xlen> <ylen>");
- exit(0);
- }
- width = atoi(argv[2]);
- height = atoi(argv[3]);
- ginit();
- gscreen(17);
- if ((fp = fopen(argv[1], "rb")) != NULL)
- {
- int i,j;
- for (i=0; i<height; i++)
- {
- char linebuf[3000];
- fread(linebuf, 2, width, fp);
- gputblk(linebuf, 0, i, width, 1, 0);
- }
- fclose(fp);
- }
- _getche();
- return 0;
- }
-